package com.csyf.manager.utils;

/**
 * 获取xml中某个标签的内容
 */
public class XmlParseHelper {

    /**
     * 响应信息获取
     * 获取报文中<result_code></result_code>部分
     * @param sourceXml  所要获取的源xml
     * @Param startLabel 开始标签
     * @Param endLabel 结束标签
     * @Param len 截取的长度
     * @return
     */
    public static  String getXmlContent(String sourceXml, String startLabel, String endLabel, int len) {
        int s_index = sourceXml.indexOf(startLabel);
        int e_index = sourceXml.indexOf(endLabel);
        String resultCode = null;
        if (s_index > 0) {
            resultCode = sourceXml.substring(s_index + len, e_index);
        }
        return resultCode;
    }


}
